//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using CommunityServer.Components;

namespace CommunityServer.Discussions.Components
{
	/// <summary>
	/// Summary description for CensorshipModule.
	/// </summary>
	public class CensorshipModule : BaseForumFormattedBodyModule
	{
		public CensorshipModule()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		protected override void Format(ForumPost post)
		{
			if( CSContext.Current.SiteSettings.EnableCensorship )
			{
				post.FormattedBody = Transforms.CensorPost( post.FormattedBody );
				post.Subject = Transforms.CensorPost( post.Subject );
				post.VideoDuration = Transforms.CensorPost (post.VideoDuration);
			
				if(post.PostID > 0)
					post.EditNotes = Transforms.CensorPost( post.EditNotes );
			}
		}
	}
}
